from bottle import route, run, view  # 导入view


@route('/hello')
@view('hello_template')  # 使用view()修饰器来渲染模版
def hello():
    name = "乾楠有"
    blog = "http://changfei.blog.51cto.com"
    myfriend = ['奥巴马', '普京', '卡梅伦']
    myinfodir = {'age': 29, 'weight': 138}
    info = {'name': name, 'age': myinfodir, 'weight': myinfodir, 'blog': blog, 'SNS': myfriend}  # 这里使用字典传送数据到模版
    return info
run(host='0.0.0.0', port=8000, debug=True)